﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Web.Prop;

namespace Web.pages
{
    public partial class logout : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //
                Dao.UserlogDao.Init().Add(new Userlog()
                {
                    UID = ((USER)Session["UserInfo"]).UID
                    ,
                    LASTIP = Request.ServerVariables["REMOTE_ADDR"]
                    ,
                    UPDATE = DateTime.Now
                    ,
                    EVENT = Core.Events.LogOut.ToString()
                });
                //
                Response.Redirect("~/singin.aspx");
            }
            catch (Exception ex)
            {
                Dao.TransactionlogDao.Init().Add(new Transactionlog()
                {
                    UID = ((USER)Session["UserInfo"]).UID
                    ,
                    EVENT = Core.Events.Error.ToString()
                    ,
                    LASTIP = Request.ServerVariables["REMOTE_ADDR"]
                    ,
                    UPDATE = DateTime.Now
                    ,
                    DESCRIPT = ex.Message
                });
            }
        }
    }
}